package offerv1;

import java.util.BitSet;

public class Offer03 {
    //位图
    public int findRepeatNumber(int[] nums) {
        int[] test = new int[]{1,2,3,4};
        BitSet set = new BitSet();
        for (int num : nums) {
            if (set.get(num)) {
                return num;
            }

            set.set(num);
        }
        return -1;
    }
}
